package com.thermal.thermal_inspection.service.impl;

import com.thermal.thermal_inspection.entity.Report;
import com.thermal.thermal_inspection.mapper.ReportMapper;
import com.thermal.thermal_inspection.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ReportServiceImpl implements ReportService {

    @Autowired
    private ReportMapper reportMapper;

    @Override
    public Report getById(Integer id) {
        return reportMapper.selectById(id);
    }

    @Override
    public List<Report> getAll() {
        return reportMapper.selectAll();
    }

    @Override
    public int add(Report report) {
        return reportMapper.insertReport(report);
    }

    @Override
    public int update(Report report) {
        return reportMapper.updateReport(report);
    }

    @Override
    public int delete(Integer id) {
        return reportMapper.deleteById(id);
    }
    // ReportServiceImpl.java

    @Override
    public List<Report> searchReports(String patientName, String gender, String phone) {
        return reportMapper.searchReports(patientName, gender, phone);
    }

}

